package main

import (
	"fmt"
	"io"
	"net"
)

func main() {
	var (
		host          = "www.apache.org"
		port          = "80"
		remote        = host + ":" + port
		msg    string = "GET / \n"
		data          = make([]uint8, 4096)
		err    error  = nil
		count  int    = 0
	)

	conn, errCon := net.Dial("tcp", remote)
	io.WriteString(conn, msg)
	if errCon != nil {
		fmt.Println("Error dial: ", err)
		return
	}
	io.WriteString(conn, msg)
	for err == nil {
		count, err = conn.Read(data)
		fmt.Print(string(data[:count]))
	}
	conn.Close()
}
